package com.medical.common;

import java.io.Serializable;
import java.util.List;

/**
 * 分页结果类
 * 
 * @param <T> 数据类型
 */
public class PageResult<T> implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    private Long total;
    private List<T> records;
    
    public PageResult() {
    }
    
    public PageResult(Long total, List<T> records) {
        this.total = total;
        this.records = records;
    }
    
    public static <T> PageResult<T> of(Long total, List<T> records) {
        return new PageResult<>(total, records);
    }
    
    // Getters and Setters
    public Long getTotal() {
        return total;
    }
    
    public void setTotal(Long total) {
        this.total = total;
    }
    
    public List<T> getRecords() {
        return records;
    }
    
    public void setRecords(List<T> records) {
        this.records = records;
    }
}
